package test1224;

public class Test07 {
    public static void main(String[] args) {
        // 求出arr中元素的平均值
        int[] arr = {6, 1, 7, 4, 3};
        int sum = 0;
        for (int i = 0; i < arr.length; i++) {
            sum += arr[i]; // 累加当前元素到sum
        }
        double average = (double) sum / arr.length;
        System.out.println(average);
    }
}
